package com.dto;

import com.enums.StateEnum;

/**
 * Created by Yuicon on 2016/7/13.
 * 存储接口返回结果
 */
public class Execution<T> {

    private int state;

    private String stateInfo;

    private T data;

    public Execution(StateEnum stateEnum, T data) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.data = data;
    }

    public Execution(StateEnum stateEnum) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
